package com.kfc.po;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;



@Entity
public class Client {
	@Id
	private Integer clientId;
	@Column(length=32,nullable=false)
	private String clientName;
	@Column(columnDefinition="char(1)")
	private boolean sex;
	@Column(length=11,nullable=false)
	private String phone;
	Set<String> phones=new HashSet<String>();
	@Column(length=32)
	private String email;
	@ElementCollection
	@Embedded
	@AttributeOverrides(@AttributeOverride(name="address", column = @Column))
	@OneToMany(mappedBy="c",cascade=CascadeType.ALL)
	Set<Address> addrs=new HashSet<Address>();
	@Column(length=32)
	private String passwd;
	
}
